package com.tedu._04mybatis.mapper;

import com.tedu._04mybatis.pojo.Comment;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

@Mapper
public interface CommentMapper {
//    @Insert("INSERT INTO comment (content ,created,weibo_id,user_id) values (#{content},#{created},#{weiboId},#{userId})")
    int insert(Comment comment);

    @Delete("DELETE FROM comment WHERE id=#{id}")
    int delete(int id);

    @Update("UPDATE comment SET content=#{content},created=#{created},weibo_id=#{weiboId},user_id=#{userId} WHERE user_id=#{userId}")
    int update(Comment comment);
}
